<!-- HTML header for doxygen 1.8.11-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>i2cpwm_board: src/i2cpwm_controller.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <a href="./index.html"><div id="projectname">i2cpwm_board
   &#160;<span id="projectnumber">0.5.1</span>
   </div></a>
   <div id="projectbrief">ROS Package for PCA9685 based 16 channel PWM Board with I2C Interface</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">i2cpwm_controller.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>controller for I2C interfaced 16 channel PWM boards with PCA9685 chip  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;math.h&gt;</code><br />
<code>#include &lt;fcntl.h&gt;</code><br />
<code>#include &lt;errno.h&gt;</code><br />
<code>#include &lt;unistd.h&gt;</code><br />
<code>#include &lt;sys/ioctl.h&gt;</code><br />
<code>#include &lt;sys/types.h&gt;</code><br />
<code>#include &lt;sys/stat.h&gt;</code><br />
<code>#include &lt;linux/i2c-dev.h&gt;</code><br />
<code>#include &lt;ros/ros.h&gt;</code><br />
<code>#include &lt;ros/console.h&gt;</code><br />
<code>#include &lt;std_srvs/Empty.h&gt;</code><br />
<code>#include &lt;geometry_msgs/Twist.h&gt;</code><br />
<code>#include &quot;i2cpwm_board/Servo.h&quot;</code><br />
<code>#include &quot;i2cpwm_board/ServoArray.h&quot;</code><br />
<code>#include &quot;i2cpwm_board/ServoConfig.h&quot;</code><br />
<code>#include &quot;i2cpwm_board/ServoConfigArray.h&quot;</code><br />
<code>#include &quot;i2cpwm_board/ServosConfig.h&quot;</code><br />
<code>#include &quot;i2cpwm_board/DriveMode.h&quot;</code><br />
<code>#include &quot;i2cpwm_board/Position.h&quot;</code><br />
<code>#include &quot;i2cpwm_board/PositionArray.h&quot;</code><br />
<code>#include &quot;i2cpwm_board/IntValue.h&quot;</code><br />
</div>
<p><a href="i2cpwm__controller_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaa3fe8c6f5a98243c302c0d27cea219d9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___topics.html#gaa3fe8c6f5a98243c302c0d27cea219d9">servos_absolute</a> (const i2cpwm_board::ServoArray::ConstPtr &amp;msg)</td></tr>
<tr class="memdesc:gaa3fe8c6f5a98243c302c0d27cea219d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">subscriber topic to move servos in a physical position  <a href="group___topics.html#gaa3fe8c6f5a98243c302c0d27cea219d9">More...</a><br /></td></tr>
<tr class="separator:gaa3fe8c6f5a98243c302c0d27cea219d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1262b2e51072c237c51b6de4cb199e53"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___topics.html#ga1262b2e51072c237c51b6de4cb199e53">servos_proportional</a> (const i2cpwm_board::ServoArray::ConstPtr &amp;msg)</td></tr>
<tr class="memdesc:ga1262b2e51072c237c51b6de4cb199e53"><td class="mdescLeft">&#160;</td><td class="mdescRight">subscriber topic to move servos in the range of ±1.0  <a href="group___topics.html#ga1262b2e51072c237c51b6de4cb199e53">More...</a><br /></td></tr>
<tr class="separator:ga1262b2e51072c237c51b6de4cb199e53"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae257665eb64139d2720ed332e61507c6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___topics.html#gae257665eb64139d2720ed332e61507c6">servos_drive</a> (const geometry_msgs::Twist::ConstPtr &amp;msg)</td></tr>
<tr class="memdesc:gae257665eb64139d2720ed332e61507c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">subscriber topic to move servos based on a drive mode  <a href="group___topics.html#gae257665eb64139d2720ed332e61507c6">More...</a><br /></td></tr>
<tr class="separator:gae257665eb64139d2720ed332e61507c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga948cb0dd7ba8c2ac4c7f2d2d93940d85"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___services.html#ga948cb0dd7ba8c2ac4c7f2d2d93940d85">set_pwm_frequency</a> (i2cpwm_board::IntValue::Request &amp;req, i2cpwm_board::IntValue::Response &amp;res)</td></tr>
<tr class="memdesc:ga948cb0dd7ba8c2ac4c7f2d2d93940d85"><td class="mdescLeft">&#160;</td><td class="mdescRight">service to set set PWM frequency  <a href="group___services.html#ga948cb0dd7ba8c2ac4c7f2d2d93940d85">More...</a><br /></td></tr>
<tr class="separator:ga948cb0dd7ba8c2ac4c7f2d2d93940d85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabf512716d4497c6a4cb7bf9c5d94e2f1"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___services.html#gabf512716d4497c6a4cb7bf9c5d94e2f1">config_servos</a> (i2cpwm_board::ServosConfig::Request &amp;req, i2cpwm_board::ServosConfig::Response &amp;res)</td></tr>
<tr class="memdesc:gabf512716d4497c6a4cb7bf9c5d94e2f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">store configuration data for servos on the active board  <a href="group___services.html#gabf512716d4497c6a4cb7bf9c5d94e2f1">More...</a><br /></td></tr>
<tr class="separator:gabf512716d4497c6a4cb7bf9c5d94e2f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae3222f92a0cd33b0d0a2fcfd6d563ba9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___services.html#gae3222f92a0cd33b0d0a2fcfd6d563ba9">config_drive_mode</a> (i2cpwm_board::DriveMode::Request &amp;req, i2cpwm_board::DriveMode::Response &amp;res)</td></tr>
<tr class="memdesc:gae3222f92a0cd33b0d0a2fcfd6d563ba9"><td class="mdescLeft">&#160;</td><td class="mdescRight">set drive mode and drive servos  <a href="group___services.html#gae3222f92a0cd33b0d0a2fcfd6d563ba9">More...</a><br /></td></tr>
<tr class="separator:gae3222f92a0cd33b0d0a2fcfd6d563ba9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4583b417d172bde68e75db603da3362e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___services.html#ga4583b417d172bde68e75db603da3362e">stop_servos</a> (std_srvs::Empty::Request &amp;req, std_srvs::Empty::Response &amp;res)</td></tr>
<tr class="memdesc:ga4583b417d172bde68e75db603da3362e"><td class="mdescLeft">&#160;</td><td class="mdescRight">service to stop all servos on all boards  <a href="group___services.html#ga4583b417d172bde68e75db603da3362e">More...</a><br /></td></tr>
<tr class="separator:ga4583b417d172bde68e75db603da3362e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>controller for I2C interfaced 16 channel PWM boards with PCA9685 chip </p>
<dl class="section author"><dt>Author</dt><dd>Bradan Lane Studio <a href="#" onclick="location.href='mai'+'lto:'+'inf'+'o@'+'bra'+'da'+'nla'+'ne'+'.co'+'m'; return false;">info@<span style="display: none;">.nosp@m.</span>brad<span style="display: none;">.nosp@m.</span>anlan<span style="display: none;">.nosp@m.</span>e.co<span style="display: none;">.nosp@m.</span>m</a> </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (c) 2016, Bradan Lane Studio</dd></dl>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p><ul>
<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
<li>The name of Bradan Lane, Bradan Lane Studio nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.</li>
</ul>
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BRADAN LANE STUDIOS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
<p>Please send comments, questions, or patches to <a href="#" onclick="location.href='mai'+'lto:'+'inf'+'o@'+'bra'+'da'+'nla'+'ne'+'.co'+'m'; return false;">info@<span style="display: none;">.nosp@m.</span>brad<span style="display: none;">.nosp@m.</span>anlan<span style="display: none;">.nosp@m.</span>e.co<span style="display: none;">.nosp@m.</span>m</a> </p>

<p>Definition in file <a class="el" href="i2cpwm__controller_8cpp_source.html">i2cpwm_controller.cpp</a>.</p>
</div></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.11-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
